home *** CD-ROM | disk | FTP | other *** search
- -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C)
- -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
- --
- class TRY_ANIMAL
-
- creation {ANY}
- make
-
- feature {ANY}
-
- x: ANIMAL;
-
- make is
- local
- dog: DOG;
- cat: CAT;
- mille_pattes: MILLE_PATTES;
- animal: ANIMAL;
- do
- !!dog;
- !!cat;
- un("cat",cat);
- animal := clone(cat);
- un("cat",animal);
- animal := clone(dog);
- un("dog",animal);
- animal := clone(mille_pattes);
- un("rien du tout",animal);
-
- !MILLE_PATTES!animal;
- animal := clone(animal);
- un("mille pattes",animal);
-
- if dog.is_equal(dog) then
- std_output.put_string("Good :-)%N");
- else
- std_output.put_string("Bad :-(%N");
- end;
- if animal.is_equal(animal) then
- std_output.put_string("Good :-)%N");
- else
- Current.std_output.put_string("Bad :-(%N");
- end;
- if equal(animal,animal) then
- std_output.put_string("Good :-)%N");
- else
- Current.std_output.put_string("Bad :-(%N");
- end;
- end;
-
- un(quoi: STRING; a: ANIMAL) is
- do
- std_output.put_string("Voici un ");
- std_output.put_string(quoi);
- std_output.put_string(" : ");
- if a /= Void then
- a.cry;
- end;
- std_output.put_new_line;
- end;
-
- end -- class TRY_ANIMAL
-